<template>
	<view>
		<c-header :userInfo = "userInfo"></c-header>
		<image :src="userInfo.avatarUrl" class="imgWH" mode=""></image>
		<view>
			
		</view>
	</view>
</template>

<script>
	import {get,set} from "@/common/js/uilt/index.js"
	import { getdata } from "@/common/js/api/user.js"
	export default {
		data() {
			return {
				userInfo:{},
				
			}
		},
		onLoad() {
			this.getdata()
		},
		async mounted() {
			
		},
		methods: {
			// getdata(){
			// 	// this.userInfo = get('userInfo')
			// },
			async getdata(){
				this.userInfo = get('userInfo')
				if(this.userInfo == ""){
					let res = await getdata()
					set('userInfo',res.result.userInfo)
					this.userInfo = res.result.userInfo
				}
				
			}
		}
	}
</script>

<style scoped lang="scss">
.imgWH{
	height: 200rpx;
	width: 200rpx;
}
</style>
